package com.cssnj.portal.web.user;

import com.cssnj.portal.domain.common.UserInfo;
import com.cssnj.portal.service.user.UserService;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping(value = "/user")
public class SetController {

    @Autowired
    UserService userService;

    @Autowired
    Environment environment;

    @RequestMapping({"/settings.do"})
    public ModelAndView settings() {
        ModelAndView modelAndView = new ModelAndView("user/settings");
        UserInfo userInfo = (UserInfo) SecurityUtils.getSubject().getPrincipal();
        modelAndView.getModelMap().put("userInfo", userInfo);
        return modelAndView;
    }
}